<style type="text/css" media="all">

#menu ul {
	list-style-type:none;       
	}
</style>

<div id="menu" style="width:30%;padding-left:0px;">
<?php
	@include_once($_SESSION['BASE']."includes/classes/class.Conexao.php");
	@include_once($_SESSION['BASE']."includes/session.php");

	extract($_GET);
	if(!isset($m))
		$m = 1;
	
	$not->sql = "SELECT * FROM menu
					WHERE id = $m";
 					
	if($not->ler() > 0){
		$not->ini();
	
		$dir = opendir('javascript/'. $not->ds_dir);
		
		while(false !== ($nome_arquivo = readdir($dir))){
			
			if(!is_dir($nome_arquivo))
				print "<script type='text/javascript' src='javascript/".$not->ds_dir."/".$nome_arquivo."'></script>\n";
		}
	}

	
	extract($_GET);
	if(!isset($m))
		$m = 1;
	$not = new Persist;
	
	$not->sql = " SELECT * FROM
						submenu INNER JOIN grupos_permissoes_menu ON submenu.id = grupos_permissoes_menu.id_submenu	
							WHERE submenu.id_menu = $m and grupos_permissoes_menu.id_grupo = ".$_SESSION['GRUPOS']."
								GROUP BY submenu.id 
									ORDER BY submenu.ds_submenu ASC";
	$not->ler();
?>

	<ul style="list-style:none;-webkit-padding-start: 0px;margin: 0; padding: 0;">

<?php
	// GERA TAG LI
	while($not->ini()){

?>	
	
	  <li class="ui-tabs-nav ui-widget-header" style="margin: 0; padding: 0;"  >
		 <table width="100%">
         	<tr><td>
          <span class="ui-icon ui-icon-carat-1-e"></span>
          	</td><td>
          <a  style="text-decoration:none;cursor:pointer" title="<?php print $not->ds_submenu ?>"
          onClick="carregaBusca('<?php print $not->ds_pagina ?>','telas',<?php $not->init != '' ? print $not->init."_init" : print ' undefined ' ?>);"> 
			  <abbr>
				  <font size="2" face="Arial, Helvetica, sans-serif">
				  <?php print utf8_encode($not->ds_submenu) ?>
				  </font>
			  </abbr> 
		  </a> 
          	</td>
           </tr>
          </table>
	  </li>

<?php
  }
?>
	</ul>
    <br />
</div>    


<div id="telas" style="width:60%;float:left;margin:10px;display:none">

</div>
